Skip to content

Conversation

@devin-ai-integration
Copy link

Upgrade Angular from 9.0.1 to 18

Summary

This PR upgrades the Angular application from version 9.0.1 (Feb 2020) to Angular 18.2.14 (Oct 2025) following a strict incremental upgrade path through all major versions: 9→10→11→12→13→14→15→16→17→18.

Key Changes:

  • Angular Core: 9.0.1 → 18.2.14 (all @angular/* packages)
  • TypeScript: 3.7.5 → 5.4.5
  • Zone.js: 0.10.2 → 0.14.10
  • Angular CLI: 9.0.2 → 18.2.21
  • Build System: Updated configurations, removed deprecated options (extractCss, aot), migrated browserTargetbuildTarget
  • Configuration: Renamed browserslist.browserslistrc, removed TSLint builder from angular.json
  • Polyfills: Removed IE10/IE11 polyfills, updated zone.js import paths

Each major version upgrade was committed separately for easy rollback if needed. Angular CLI's automated migration schematics handled most breaking changes.

Review & Testing Checklist for Human

⚠️ IMPORTANT: This PR was verified only through production builds. No runtime testing was performed in a browser.

  • Run the application locally and verify:
    • Navigation between routes (top stories, new stories, show, ask, jobs, item details, user profiles) works
    • HackerNews API data loads correctly on all pages
    • No console errors appear in browser DevTools
    • Service worker registration works (check DevTools → Application → Service Workers)
  • Test production build: Run npm run build and verify it completes without errors (it should)
  • Deploy and smoke test: Deploy to staging/production environment and verify the app loads and functions correctly
  • Optional - Address warnings: Consider migrating Sass division operators and RxJS Observable imports (these are pre-existing, not introduced by this upgrade)

Notes

  • Incremental commits: Each major version upgrade (9→10, 10→11, etc.) was committed separately for easier git bisect if issues arise
  • Persistent warnings: Build warnings about Sass deprecations and RxJS optimization exist but are pre-existing issues, not introduced by this upgrade
  • Test suite: The test commands have pre-existing issues in the codebase and were not run
  • Migration considerations: The task mentioned considering TSLint→ESLint and Protractor→Cypress/Playwright migrations, but these were treated as separate future work and not included in this PR
  • Link to Devin run: https://app.devin.ai/sessions/4e3d53fa845f4f4e9090accabaa73dc1
  • Requested by: Kevin Tang (@kevintang513)

devin-ai-integration bot and others added 9 commits October 15, 2025 17:24
- Upgraded @angular/core and @angular/cli to version 10
- Removed deprecated 'extractCss' option from angular.json
- Renamed browserslist to .browserslistrc (Angular 10+ convention)
- Updated TSLint to version 6
- Updated TypeScript compiler options (module and target)
- Verified production build works successfully

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 11
- Updated TypeScript to version 4.0
- Updated RouterModule configuration for relativeLinkResolution
- Applied migrations for AbstractControl.parent null handling
- Replaced ViewEncapsulation.Native with ViewEncapsulation.ShadowDom
- Renamed async to waitForAsync in testing
- Verified production build works successfully

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 12
- Updated TypeScript to version 4.3.5
- Updated zone.js to version 0.11.x
- Removed 'emitDecoratorMetadata' from tsconfig.json
- Updated lazy loading syntax to use dynamic imports
- Removed deprecated ViewEngine-based i18n options
- Updated Web Worker usage for Webpack 5
- Replaced deprecated '--prod' flag with '--configuration production'
- Made ActivatedRouteSnapshot.fragment nullable
- Migrated /deep/ selector to ::ng-deep
- Verified production build works successfully

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 13
- Updated TypeScript to version 4.6.4
- Removed IE11 polyfills (no longer supported)
- Updated .gitignore to include .angular/cache
- Removed deprecated options from angular.json
- Migrated [routerLink]="" to [routerLink]="[]"
- Updated TestBed teardown flag for existing apps
- Removed entryComponents (no longer necessary)
- View Engine completely removed, Ivy only
- Verified production build works successfully
- Build now uses single bundle format (no more ES5/ES2015 differential loading)

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 14
- Removed 'defaultProject' option from workspace configuration
- Removed 'showCircularDependencies' option from builders
- Replaced 'defaultCollection' with 'schematicCollections'
- Updated Angular packages version prefix from '~' to '^'
- Updated TypeScript compilation target to 'ES2020'
- Updated pathMatch property of Routes to strict union type
- Forms model classes now accept type parameters (opted out for backwards compatibility)
- Verified production build works successfully

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 15
- Updated TypeScript to version 4.9.5
- Removed no longer needed require calls in Karma builder main file
- Updated TypeScript compiler target to ES2022 and set useDefineForClassFields
- Removed deprecated relativeLinkResolution from Router config
- Replaced RouterLinkWithHref with RouterLink
- Verified production build works successfully

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 16
- Upgraded zone.js to version 0.13.3 (from 0.11.8)
- Removed 'defaultProject' option from workspace configuration
- Replaced 'defaultCollection' with 'schematicCollections'
- Updated '@angular-devkit/build-angular:server' builder configuration
- Removed deprecated guard and resolver interfaces
- Removed deprecated moduleId property from @component
- Verified production build works successfully

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 17
- Updated TypeScript to version 5.4.5 (from 4.9.5)
- Upgraded zone.js to version 0.14.10 (from 0.13.3)
- Replaced deprecated options in angular.json
- Updated new control flow syntax handling
- Updated TransferState imports from @angular/platform-browser to @angular/core
- Removed unused CompilerOptions (useJit and missingTranslation)
- Updated two-way bindings with invalid expressions
- Verified production build works successfully

Co-Authored-By: Kevin Tang <[email protected]>
- Upgraded @angular/core and @angular/cli to version 18.2.14
- Final upgrade in the incremental path from Angular 9.0.1 to Angular 18
- Updated two-way bindings with invalid expressions
- Replaced deprecated HTTP modules with provider functions
- Updated afterRender calls with explicit phase
- Added BootstrapContext to bootstrapApplication calls
- Skipped optional migration to new application builder
- Verified production build works successfully
- All incremental upgrades (9→10→11→12→13→14→15→16→17→18) completed

Co-Authored-By: Kevin Tang <[email protected]>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant